<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function getfuction(obj) {
            console.log(obj.message)
        }
        let url = "http://127.0.1?func=getfuncion"
        let a = document.createElement('script')
        a.setAttribute("src", url)
        a.setAttribute('type', 'text/javascript')
        document.getElementsByTagName("head")[0].appendChild(a)
    </script>
</body>

</html>